package com.logistics.pick.entity.model;

import com.logistics.pick.entity.domain.PickAndErpInvbill;
import lombok.Data;

import java.util.Date;

@Data
public class PickDetailInfoRow {

    //拣配单号
    private String pickCode;

    //状态
    private String status;

    //状态描述
    private String statusName;

    //托盘号
    private String container;

    //班组编号
    private String wcCode;

    //班组名称
    private String wcName;

    //erp领料单类型
    private Integer erpInvbillType;

    //erp领料单类型描述
    private String erpInvbillTypeName;

    //物料编码
    private String itemCode;

    //物料任务号
    private String itemWorkcode;

    //物料工序号
    private String itemOpNo;

    //物料名称
    private String itemName;

    //物料单位
    private String itemUnit;

    //实际拣配数量
    private String itemQty;

    //WMS标签数量
    private String qty;

    //后工序开工时间
    private Date nextStartDate;

    //配送终点描述
    private String endLocationName;

    //领料单号
    private String erpInvbillCode;

    //优先级
    private Integer priority;

    //缺料状态（1:不缺料,0:缺料）
    private Integer lackMaterialStatus;

    //缺料状态描述
    private String lackMaterialStatusName;

    //拣配人
    private String updater;

    PickDetailInfoRow(){}

    public PickDetailInfoRow(PickAndErpInvbill pickAndErpInvbill){
        this.pickCode = pickAndErpInvbill.getCode();
        this.status = String.valueOf(pickAndErpInvbill.getStatus());
        this.container = pickAndErpInvbill.getContainer();
        this.wcCode = pickAndErpInvbill.getWcCode();
        this.wcName = pickAndErpInvbill.getWcName();
        this.erpInvbillType = pickAndErpInvbill.getErpInvbillType();
        this.itemCode = pickAndErpInvbill.getItemCode();
        this.itemWorkcode = pickAndErpInvbill.getItemWorkcode();
        this.itemOpNo = pickAndErpInvbill.getItemOpNo();
        this.itemName = pickAndErpInvbill.getItemName();
        this.itemUnit = pickAndErpInvbill.getItemUnit();
        this.itemQty = pickAndErpInvbill.getItemQty();
        this.endLocationName = pickAndErpInvbill.getEndLocationName();
        this.erpInvbillCode = pickAndErpInvbill.getErpInvbillCode();
        this.priority = pickAndErpInvbill.getPriority();
        this.lackMaterialStatus = pickAndErpInvbill.getLackMaterialStatus();
        this.updater = pickAndErpInvbill.getUpdater();
    }

    public static PickDetailInfoRow build(PickAndErpInvbill pickAndErpInvbill){
        return new PickDetailInfoRow(pickAndErpInvbill);
    }
}
